<section class="content-header" >
    <h1>
        车队长管理
        <small>车队长列表</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="{:U('/Admin/index')}"><i class="fa fa-home"></i>首页</a></li>
        <li class="active">车队长管理</li>
    </ol>
</section>
<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <div class="box-title"><label >车队长列表</label></div>
                    <div class="pull-right">
                        <button class="btn btn-block btn-primary btn-sm "onclick="addTaskToCar()"><i class="fa fa-plus"></i>&nbsp;&nbsp;&nbsp;添加车队长</button>
                    </div>
                </div><!-- /.box-header -->
                <div class="box-body">
                    <table id="table" class="table table-bordered table-striped" width="100%">
                        <thead>
                            <tr>
                                <th>编号</th>
                                <th>车队长姓名</th>
                                <th>手机号码</th>
                                <th>操作</th>
                            </tr>
                            <volist name="list" id="v">
                                <tr>
                                    <th>{$v.id}</th>
                                    <th>{$v.name}</th>
                                    <th>{$v.mobile}</th>
                                    <th><a href="javascript:"  onclick="uptateItem({$v.id})" >编辑</a>-
                                        <a href="javascript:" onclick="del({$v.id})">删除</a>
                                    </th>
                                </tr>
                            </volist>
                        </thead>
                    </table>
                </div><!-- /.box-body -->
            </div><!-- /.box -->
        </div><!-- /.col -->
    </div><!-- /.row -->
</section><!-- /.content -->
<!-- DATA TABES SCRIPT -->
<!-- page script -->
<script type="text/javascript">
    function uptateItem(id) {
        var url = "{:U('captain/add')}";
        url += url.indexOf('?') != -1 ? '&id=' + id : '?id=' + id;
        $.dialog(url, '修改车队长信息', null,50);
    }
    function addTaskToCar() {
        $.dialog("{:U('captain/add')}", '添加车队长',null,50);
    }
    function del(id) {
        var url = "{:U('captain/del')}";
        url += url.indexOf('?') != -1 ? '&id=' + id : '?id=' + id;
        $.get(url,function (msg) {
            if(msg.status==1){
                alert(msg.info);
                var url = $("#pageContent").attr("href");
                loadContent(url);
            }else{
                alert(msg.info);
            }
        },'json')
    }
</script>